package com.wlyuan.open.domain.api.utils;


import com.wlyuan.open.domain.client.OpenClientBindId;
import lombok.extern.slf4j.Slf4j;

import java.util.Optional;

/**
 * @author yuanzheng
 */
@Slf4j
public class MappingOpenClientBind {
    public OpenClientBindId create(Long value) {
        return Optional.ofNullable(value)
                .map(OpenClientBindId::new)
                .orElse(null);
    }

    public Long value(OpenClientBindId source) {
        return Optional.ofNullable(source).map(s -> s.getId()).orElse(null);
    }
}
